package collections;

import java.util.NavigableMap;
import java.util.TreeMap;

import com.google.common.collect.DiscreteDomain;
import com.google.common.collect.Range;

public class RangeMapDemo {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		use();
	}
	
	public static void use() {
		NavigableMap<Integer, String> times=new TreeMap<Integer, String>();
		times.put(905,"镇远");
		times.put(1005,"定远");
		times.put(1145,"威远");
		times.put(1230,"经远");
		times.put(1510,"来远");
		times.put(2000,"致远");
		times.put(2100,"靖远");
		times.put(2200,"济远");
		times.put(2300,"平远");
		
		System.out.println(times.ceilingEntry(1510));
		
		Range<Integer> r1 = Range.closedOpen(10, 15);
		System.out.println(r1);
		r1.canonical(DiscreteDomain.integers());
		
		Range<Integer> r2 = Range.closedOpen(16,19);
		System.out.println(r2);
		r2.canonical(DiscreteDomain.integers());
		
//		r1.
//		System.out.println(r1);
	}
}
